package cn.school.thoughtworks.section3;

import java.util.List;
import java.util.Map;

public class PracticeB {
    private int FullThreeMinusOne(int count){
        int result =count;
        if(count>=3){
            result = count-count/3;
        }
        return result;
    }
    Map<String,Integer> createUpdatedCollection(Map<String,Integer> collectionA, Map<String,List<String>> object) {
        //实现练习要求，并改写该行代码。
        List<String> arr = object.get("value");
        for (Map.Entry<String,Integer> entry:collectionA.entrySet()){
            String ch = entry.getKey();
            Integer count = entry.getValue();
            if (arr.contains(ch)){
                collectionA.put(ch,FullThreeMinusOne(count));
            }
        }
        return collectionA;
    }




}
